<?php

namespace App\Http\Requests\Api;

class ResumeCertificateRequest extends ApiRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id' => $this->is('*/update') ? 'bail|required|integer' : '',
            'resume_id' => $this->is('*/create') ? 'bail|required|integer' : '',
            'certificate_name' => 'required',
            'gettime' => 'bail|required|before:now',
        ];
    }

    /*
     * 字段描述
     */
    public function attributes()
    {
        return [
            'certificate_name' => '证书名称',
            'gettime' => '获得时间',
        ];
    }

    public function messages()
    {
        return array_merge(parent::messages(),[
            'gettime'=>':attribute不能小于现在',
        ]);
    }
}